<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 * 
 * 创建时间：2021-05-15 13:10
 *
 * 项目：upload  -  $  - index.php
 *
 * 作者：liwei 
 */
?>

<div class="page page-admin">
    <div class="navbar page-admin-navbar adminbar navbar-bgcolor-red">
        <div class="navbar-inner">
            <div class="left">
                <?=\lev\widgets\adminModulesNav\adminModulesNav::buttonHtm()?>
                <a class="link tooltip-init" href="javascript:window.history.back();" data-tooltip="后退">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-back"></use></svg>
                </a>
                <a class="link tooltip-init" href="javascript:window.location.reload();" data-tooltip="刷新">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-refresh"></use></svg>
                </a>
                <a class="link deleteCheckAll">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-trash"></use></svg>
                </a>
            </div>
            <div class="title">
                <?php echo Lev::$app['title']?>
                <tips class="date" style="color:red !important;"></tips>
            </div>
            <div class="right">
                <a target="_blank" class="button button-fill color-black scale8 transr" href="<?php echo Lev::toReRoute(['superman/set-caches', 'id'=>APPVIDEN])?>">
                    更新缓存
                </a>
                <a class="button button-fill color-yellow scale9" href="<?php echo Lev::toCurrent(['r'=>'modules/form'])?>">创建模块</a>
            </div>

            <?php echo \lev\helpers\ModulesHelper::getAdminSubnavHtmsAndBox()?>
        </div>
    </div>

    <div class="page-content">
        <div class="card data-listb">
            <div class="data-xtable">
                <table><thead><tr>
                        <th class="checkbox-cell tab-center wd30"><input name="ids[]" type="checkbox" onclick="checkedToggle(this,'input[name=\'ids[]\']')"></th>
                        <th class="label-cell wd100">标识符</th>
                        <th class="label-cell">名称 <svg class="icon"><use xlink:href="#fa-huoj"></use></svg></th>
                        <th class="label-cell wd100">版本号/版权</th>
                        <th class="label-cell ellipsis">简短描述</th>
                        <th class="tab-center wd60">状态</th>
                        <th class="numeric-cell wd60">时间</th>
                        <th class="tab-center wd60">设置</th>
                        <th class="tab-center wd60">设计</th>
                        <th class="tab-center wd80">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if (!empty($lists)):foreach ($lists as $v):$s = Lev::getSettings($v['settings']);?>
                        <tr>
                            <td class="checkbox-cell tab-center"><input name="ids[]" type="checkbox" value="<?php echo $v['id']?>" autocomplete="off"></td>
                            <td class="label-cell">
                                <?php if ($v['classdir']):?>
                                    <a href="<?php echo Lev::toCurrent(['classdir'=>$v['classdir']])?>"><?php echo $v['classdir']?></a>
                                    <p><?php echo $v['identifier']?></p>
                                <?php else:?>
                                    <?=$v['identifier'] == APPVIDEN ? '<absxy>Lev主</absxy>':'<absxg>前置</absxg>'?>
                                    <p><a class="color-red" href="<?php echo Lev::toReRoute(['superman/modules', 'id'=>$v['identifier']])?>">
                                            <?php echo $v['identifier']?>
                                        </a>
                                    </p>
                                <?php endif;?>
                            </td>
                            <td class="label-cell">
                                <a _bk=1 target="_blank" href="<?php echo Lev::toReRoute(['/', 'id'=>($v['classdir']?$v['classdir'].':':'').$v['identifier']])?>"><?php echo $v['name']?></a>
                                <p class="date transl"><?php echo date('Ymd.His', $v['versiontime'])?></p>
                            </td>
                            <td class="label-cell">
                                <input type="text" class="setField date transl wd100" name="version" opid="<?=$v['id']?>" value="<?=$v['version']?>" autocomplete="off">
                                <p class="date transl"><?php echo $v['copyright']?></p>
                            </td>
                            <td class="label-cell">
                                <div class="mud-navb buttons-row scale6 transl">
                                    <?php echo \lev\helpers\ModulesHelper::getAdminNavHtms($v)?>
                                </div>
                                <p class="date transl"><?php echo $v['descs']?></p>
                            </td>
                            <td class="tab-center">
                                <p class="date"><?=$v['identifier']?></p>
                                <label class="label-switch scale7 color-green setStatus" opid="<?php echo $v['id']?>">
                                    <input type="checkbox" <?=$v['status']?'':'checked'?>>
                                    <div class="checkbox"></div>
                                </label>
                            </td>
                            <td class="numeric-cell">
                                <p class="date transr"><?php echo Lev::asRealTime($v['uptime'])?></p>
                                <p class="date transr"><?php echo Lev::asRealTime($v['addtime'])?></p>
                            </td>
                            <td class="tab-center">
                                <p><a href="<?=Lev::toCurrent(['r'=>'superman/settings','iden'=>$v['identifier']])?>"><svg class="icon"><use xlink:href="#fa-set"></use></svg></a></p>
                                <p><a href="<?=Lev::toCurrent(['r'=>'modules/export', 'opid'=>$v['id']])?>"><absxy>导出</absxy></a></p>
                            </td>
                            <td class="tab-center">
                                <div class="buttons-row scale6" style="height: 22px;">
                                    <a class="button button-fill color-lightblue" title="压缩" target="_blank" href="<?=Lev::toCurrent(['r'=>'modules/zip','iden'=>$v['identifier'],'opid'=>$v['id']])?>"><svg class="icon"><use xlink:href="#fa-txb"></use></svg></a>
                                    <a class="button button-fill color-orange" title="上传" target="_blank" href="<?=Lev::toReRoute(['upload-mud','iden'=>$v['identifier'],'opid'=>$v['id']])?>"><svg class="icon"><use xlink:href="#fa-up"></use></svg></a>
                                </div>
                                <div class="buttons-row scale6" style="height: 22px;">
                                    <a class="button button-fill color-yellow" href="<?=Lev::toCurrent(['r'=>'settings', 'iden'=>$v['identifier']])?>">设计</a>
                                    <?php if (!empty($s['dropTables'])):?>
                                    <a class="button button-fill color-black hiddenx" title="老版表单字段管理，已停止维护(废弃)" href="<?=Lev::toCurrent(['r'=>'settings/export', 'iden'=>$v['identifier'], 'ac'=>3, 'opid'=>$v['id']])?>">表单</a>
                                        <a class="button button-fill color-black" href="<?=Lev::toCurrent(['r'=>'settings', 'isForm'=>1, 'iden'=>$v['identifier']])?>">表单2</a>
                                    <?php endif;?>
                                </div>
                            </td>
                            <td class="tab-center">
                                <div class="scale6 buttons-row">
                                <?php if (\lev\helpers\ModulesHelper::checkNewConfig($v)):?>
                                    <a class="button-fill button color-red shake animated wdmin" href="<?php echo Lev::toReRoute(['superman/update-module', 'id'=>APPVIDEN, 'iden'=>$v['identifier'], 'classdir'=>$v['classdir']])?>">更新</a>
                                <?php endif;?>
                                <a class="button-fill button wdmin" href="<?php echo Lev::toCurrent(['r'=>'modules/form', 'opid'=>$v['id']])?>">
                                    编辑
                                </a>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; endif;?>
                    </tbody>
                </table>
                <div class="card-footer">
                    <tips></tips>
                </div>
            </div>
        </div>
    </div>

</div>
